#pragma once
#include "TPColorBase.h"
class TPGradientTemplate : public CTPColorBase
{
public:
	TPGradientTemplate(void);
	~TPGradientTemplate(void);

public:
	virtual BOOL FillColor(LPVOID pColorData, BYTE* & pBuffer, int nWidth, int nHeight, eBufferFormat eFormat) ;
	virtual int	 SaveColorToBuffer(LPVOID pColorDef, LPVOID	lpBuffer, int nLength) ;
	virtual int	 LoadColorFromBuffer(LPVOID hColor,LPVOID	lpBuffer,int nLength) ;
private:
	BOOL		 FillInCMethod(LPVOID pColorData, BYTE*& pBuffer, int nWidth, int nHeight, eBufferFormat eFormat) ;
	BOOL		 ReadBitMapFile(TCHAR* pFileName, BYTE*& pDIBdata, int& nWidth, int& nHeight);
	BOOL		 FillBitMapColor(TPColorValue*& pColorBitmap, BYTE* pDIBData, const int nDIBWidth, const int nDIBHeight, const int NodeCount,const TPGradientNode* pNode);
	BOOL		 CalcColorMidPos(const TPGradientNode* pNode,const int nNodeNum, TPGradientNode*& pNewNode);
	BOOL		 InitPosTable();
private:
	float*		 m_pfPosTable;
};
